#!/bin/sh
#
# Author ： hbaolong@vip.qq.com
#
# Function : 这是一个模板
#
#
#

if [ $# -ne 1 ]; then
	echo "Usage: $0 name."
	exit
fi

localdir="/Users/hbaolong/workshop/gitee/3place/"

dirs="8313阿拉伯的劳伦斯 3502桃花扇"

badword=""

okword=""

echored [$1]

okword=$okword$newword

iexist=0

for files in `echo $dirs`
do
	cd $localdir$files 
	source config
	grep "+ "$1 $tag*.md >/dev/null

	if [ $? -eq 0 ]; then 
		let "iexist+=1"
		echogreen "[$files]"
		grep "+ "$1 *.md |awk -Fmd: '{print $2}'|sort |uniq -c |sort -rg |awk -F+ '{print "+"$2}' 
	fi
done

if [ $iexist -eq 0 ]; then 
	badword="$badword+$newword"
fi

if [ "$badword" = "" ]; then 
	echored "没有新字词"
else
	echored "请注解一下字词："
	echo $badword |sed -e "s/+/\n+ /g"|sed -e "/^$/d"|sed -e "s/$/，\n/" 
fi

